﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Ccit.Utils;

namespace Ccit.OA.NewsCenter
{
    public partial class news_queryset_frame : Ccit.Utils.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           if(!IsPostBack){
               _hidTabId.Value =( null != Request.QueryString["TABID"] ) ? Request.QueryString["TABID"].ToString() : "";

               //1:信息发布(news_submit_list.aspx?PageSource=1)   2：信息查询(news_search_frame.aspx?PageSource=2)   3：信息管理
               _hidPageSource.Value=(Request.QueryString["PageSource"]!=null)?Request.QueryString["PageSource"].ToString() : "" ;
               _hidType.Value = (null != Request.QueryString["Type"]) ? Request.QueryString["Type"].ToString() : "0"; 
           }
           string sPageParamList = "PageSource=" + _hidPageSource.Value + "&Type=" + _hidType.Value+"&TABID="+_hidTabId.Value;
           string encodeParamList = base64encode(sPageParamList);
           iFrmList.Attributes["src"] = "news_queryset_list.aspx?" + encodeParamList;
           string sPageParamEdit = "PageSource=" + _hidPageSource.Value + "&Type=" + _hidType.Value + "&Oper=0&TABID="+_hidTabId.Value;
           string encodeParamEdit = base64encode(sPageParamEdit);
           iFrmEdit.Attributes["src"] = "news_queryset_edit.aspx?" + encodeParamEdit;
        }
        private string base64encode(string sPageParam)
        {
            string encodeParam = string.Empty;
            if (string.IsNullOrEmpty(sPageParam)) return encodeParam;

            encodeParam = Base64Lib.Encode(sPageParam);
            return encodeParam;
        }
    }
}
